package com.kaifa.org.tp04.example02.dao.impl;

import com.kaifa.org.tp04.example02.bean.Product;
import com.kaifa.org.tp04.example02.dao.ProductDao;
import org.springframework.jdbc.core.JdbcTemplate;

import java.util.List;

public class ProductDaoImpl implements ProductDao {
    private JdbcTemplate jdbcTemplate2;

    public void setJdbcTemplate2(JdbcTemplate jdbcTemplate2) {
        this.jdbcTemplate2 = jdbcTemplate2;
    }

    public int add(Product pro) {
        String sql="insert into(pro_name,pro_num,pro_price) value(?,?,?)";
        Object[] args = new Object[]{pro.getPro_name(),pro.getPro_num(),pro.getPro_price()};
        return jdbcTemplate2.update(sql,args);
    }

    public int update() {
        return 0;
    }

    public int delete() {
        return 0;
    }

    public Product findProById(int id) {
        return null;
    }

    public List<Product> findAll() {
        return null;
    }

}
